<include file="../header" />
<body class="J_scroll_fixed">
<script type="text/javascript">
    $(function() {

    })
</script>
<style type="text/css">
    .btn,.btn-danger,.btn-info,.btn-success,.btn-warning{
        width: 80px;
        /*height: 18px;*/
        padding: 2px 0px 2px 0px;
        margin: 1px 0px 1px 0px;
    }
    .top {
        height: 25px;
        width: 120px;
        background-color: #1dccaa;
        line-height: 25px;
        cursor: pointer;
        display: inline-block;
        text-align: center;
        color: #fff;
        border-radius: 3px;
    }
</style>
<script language="javascript" src="/Template/js/ImgPreview.js"></script>
<form class="well form-search" method="post" style="float:left;width:100%;" action="{:U('Transfer/index')}">
    <div class="search_type cc mb10">
        <div class="mb10">
        <span class="mr20">
            单号：<input type="text" name="tf#transfer_no-like" value="{$transfer_no}" />
            &nbsp;&nbsp;
            调出仓：
            <select name="tf#store_id-eq">
                {:getCommonSelectOptionHtml($out_store_id, "Store", "store_id", "store_name", null, $user['enterprise_code'], 1)}
            </select>
            &nbsp;&nbsp;
            调入仓：
            <select name="tf#store_id-eq">
                {:getCommonSelectOptionHtml($in_store_id, "Store", "store_id", "store_name", null, $user['enterprise_code'], 1)}
            </select>
            &nbsp;&nbsp;
            <button class="btn btn-primary">搜索</button>
            <a class="btn" href="{:U('Transfer/index')}">重置</a>
        </span>
        </div>
    </div>
    <hr class="half-rule">
</form>
<div class="wrap J_check_wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:U('Transfer/index')}">调拨信息</a></li>
        <li><a href="{:U('Transfer/claimTransfer')}">新增调拨</a></li>
    </ul>
    <table class="table table-hover table-bordered">
        <thead>
        <tr>
            <th style="min-width: 160px; width: 160px">单号</th>
            <th style="min-width: 100px; width: 200px">调出仓</th>
            <th style="min-width: 100px; width: 200px">调入仓</th>
            <th style="min-width: 40px; width: 80px">操作人</th>
            <th style="min-width: 40px; width: 80px">审核人</th>
            <th style="min-width: 50px; width: 100px">申请调拨日期</th>
            <th style="">备注</th>
            <th style="min-width: 90px; width: 220px">当前状态</th>
            <th style="min-width: 165px; width: 165px">操作</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="list" item="vo">
            <tr>
                <td>{$vo.transfer_no}</td>
                <td>{$vo.out_store_name}</td>
                <td>{$vo.in_store_name}</td>
                <td>{$vo.admin_name}</td>
                <td>{$vo.auditor}</td>
                <td>{$vo.transfer_date}</td>
                <td style="white-space: pre-wrap">{$vo.remark}</td>
                <if condition = "$vo['status'] eq '-2'">
                    <td style="color: #df6b5f">[已反审，待调拨] {$vo.update_time}</td>
                </if>
                <if condition = "$vo['status'] eq '-1'">
                    <td style="color: #df6b5f">[待审核] {$vo.update_time}</td>
                </if>
                <if condition = "$vo['status'] eq '1'">
                    <td style="color: #5993df">[已审核] {$vo.update_time}</td>
                </if>
                <td>
                    <a class="btn btn-info" href='{:U("Transfer/claimTransfer",array("id"=>$vo["transfer_id"]))}'>查看详情</a>
                    <php>
                        $btnText = "入库";
                        $btnStatus = -1;
                        $role = explode(',',$user["role"]);
                        if(in_role($role,"8")){
                        if($vo["status"] == -2 || isNullOrEmpty($vo["status"])){
                        $btnText = "入库";
                        $btnStatus = 1;
                        }else{
                        $btnText = "已入库";
                        $btnStatus = -1;
                        }
                        }
                        if(in_role($role,"4")){
                        if($vo["status"] == -1){
                        $btnText = "审核";
                        $btnStatus = 1;
                        }
                        if($vo["status"] == 1){
                        $btnText = "反审核";
                        $btnStatus = 1;
                        }
                        }
                    </php>
                    <if condition="$btnStatus eq 1">
                        <a class="btn btn-danger" href='{:U("Transfer/claimTransfer",array("id"=>$vo["transfer_id"]))}'>{$btnText}</a>
                    </if>

                </td>
            </tr>
        </foreach>
        </tbody>
    </table>
    <div class="pagination">{$page}</div>
</div>
<script src="__ROOT__/statics/js/common.js"></script>
</body>
</html>